/**
 * *************************************
 * Copyright(c)2016 Dingdang Yixia 
 * All Rights Reserved.
 *
 * @File: EventDataReceController.java
 * @Package: com.ddyx.rest
 * @Description:
 * 
 * @Version: V1.0
 * @Author: Yidong.Xiang
 * @Date: 2018年1月11日 10:52:22
 * 
 * *************************************
 */
package com.ddyx.rest;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONObject;
import com.ddyx.service.EventDataHandleService;

/**
 * @ClassName: EventDataReceController.java
 * @Module: 	接收阅客AI应用平台发送的门店顾客进店事件数据
 * @Description: 
 * 
 * @author: Yidong.Xiang
 * @date: 2018年1月11日 10:52:22
 * 
 */
@Controller
@RequestMapping("/event")
public class EventDataReceController {
	@Resource
	EventDataHandleService eventDataHandleService;
	
	@ResponseBody
	@RequestMapping(value="callback",method=RequestMethod.POST,consumes="application/json", produces="application/json")
	public JSONObject callback(@RequestBody JSONObject eventData) {
		System.out.println(eventData);
		return eventDataHandleService.handle(eventData);
	}
}
